<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		
		
		<script type="text/javascript">
		
		    var str = "baaaadddmmmaabb";
	        var obj={},
	        	l = str.length,
	        	k;
	        for(var i=0 ; i < l ; i++){
	            k=str.charAt(i);
	            if(obj[k]){
	                obj[k]++;
	            }else{
	                obj[k]=1;
	            };
	        };
	        console.log(obj);
	        var m=0;
	        var i=null;
	        for(var k in obj){
	            if(obj[k]>m){
	                m=obj[k];
	                i=k;
	            };
	        };
	        console.log(i+':'+m);

		</script>
	</body>
</html>
